<?php

require_once 'Core/Db/Table/Abstract.php';
require_once 'Core/Db/Table/Row/Abstract.php';
require_once 'Core/Db/Table/Rowset/Abstract.php';

class Nld_Models_Pdf_Entry_DbTable extends Core_Db_Table_Abstract
{
	public function init()
	{
		$this->_name 					= 'pdf_entry';
		$this->_primary 			= 'id';
		$this->_rowClass 			= 'Core_Db_Table_Row_Abstract';
		$this->_rowsetClass 	= 'Core_Db_Table_Rowset_Abstract';

		$this->_dependentTables = array(
			'Page' 		=> Nld_Models::getTableClass('Pdf/Page'),
		);

		$this->_referenceMap 	= array(
			array(
				'columns'           => 'page',
				'refTableClass'     => Nld_Models::getTableClass('Pdf/Page'),
				'refColumns'        => 'id',
				'onDelete'          => self::CASCADE,
        'onUpdate'          => self::CASCADE,
			),
			array(
				'columns'           => 'author',
				'refTableClass'     => Nld_Models::getTableClass('Pdf/Author'),
				'refColumns'        => 'id',
				'onDelete'          => self::CASCADE,
        'onUpdate'          => self::CASCADE,
			),
			array(
				'columns'           => 'category',
				'refTableClass'     => Nld_Models::getTableClass('Pdf/Category'),
				'refColumns'        => 'id',
				'onDelete'          => self::CASCADE,
        'onUpdate'          => self::CASCADE,
			),
			array(
				'columns'           => 'type',
				'refTableClass'     => Nld_Models::getTableClass('Pdf/Type'),
				'refColumns'        => 'id',
				'onDelete'          => self::CASCADE,
        'onUpdate'          => self::CASCADE,
			),
    );
	}
}